<?php
/**
 * 用户中心模块
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2017/12/21
 * Time: 09:37
 */

namespace App\Http\Controllers\MiniProgram;

use Illuminate\Support\Facades\Redis;
use App\Http\Logics\MiniProgram\UserLogic;
use App\Http\Traits\UserTrait;
use App\Http\Controllers\BaseController;
class UserController extends BaseController
{
    use UserTrait;

    /**
     * 小程序登录
     * @return string
     */
    public function  onLogin(){
        $code = $this->code;
        $nick_name = $this->nickName;
        $gender = $this->gender;
        $language = $this->language;
        $city = $this->city;
        $province = $this->province;
        $country = $this->country;
        $avatar_url = $this->avatarUrl;
        $key = $this->key;
        $data = [
            'code' => $code,
            'nick_name' => $nick_name,
            'gender' => $gender,
            'language' => $language,
            'city' => $city,
            'province' => $province,
            'country' => $country,
            'avatar_url' => $avatar_url,
            'key' => $key
        ];
        $response = UserLogic::login($data);
        if ($response->code){
            $this->response($response->code, $response->message);
        }
        return $this->response(0, '登录成功！', $response->data);
    }


    /**
     * @SWG\Post(
     *     path="/user/followCafe",
     *     tags={"User"},
     *     description="用户添加对咖啡馆的关注操作接口",
     *     operationId="followCafe",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证，并且通过loginSession获取登录者信息",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="cafe_id",
     *         in="query",
     *         description="咖啡馆的ID",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Parameter(
     *         name="is_follow",
     *         in="query",
     *         description="对咖啡馆的关注状态(0:未关注|1:已关注)",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function followCafe()
    {
        $loginSession = $this->loginSession;
        $cafe_id = $this->cafe_id;
        $is_follow = $this->is_follow;
        $data = [
            'loginSession' => $loginSession,
            'cafe_id' => $cafe_id,
            'is_follow' => $is_follow
        ];
        $response = UserLogic::followCafe($data);

        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Post(
     *     path="/user/followCity",
     *     tags={"User"},
     *     description="用户添加对城市的关注操作接口",
     *     operationId="followCity",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="city_id",
     *         in="query",
     *         description="城市的ID",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Parameter(
     *         name="is_follow",
     *         in="query",
     *         description="对咖啡馆的关注状态(0:未关注|1:已关注)",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function followCity()
    {
        $loginSession = $this->loginSession;
        $city_id = $this->city_id;
        $is_follow = $this->is_follow;
        $data = [
            'loginSession' => $loginSession,
            'city_id' => $city_id,
            'is_follow' => $is_follow
        ];
        $response = UserLogic::followCity($data);

        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Post(
     *     path="/user/followMark",
     *     tags={"User"},
     *     description="用户添加对标签的关注操作接口",
     *     operationId="followMark",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证，并且通过loginSession获取登录者信息",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="mark_id",
     *         in="query",
     *         description="咖啡馆的ID",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Parameter(
     *         name="is_follow",
     *         in="query",
     *         description="对咖啡馆的关注状态(0:未关注|1:已关注)",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function followMark()
    {
        $loginSession = $this->loginSession;
        $mark_id = $this->mark_id;
        $is_follow = $this->is_follow;
        $data = [
            'loginSession' => $loginSession,
            'mark_id' => $mark_id,
            'is_follow' => $is_follow
        ];
        $response = UserLogic::followMark($data);

        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getFollowedMarkList",
     *     tags={"User"},
     *     description="获取用户关注标签的列表",
     *     operationId="getFollowedMarkList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="limit",
     *         in="query",
     *         description="分页大小",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getFollowedMarkList()
    {
        $loginSession = $this->loginSession;
        $limit = $this->limit;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getFollowedMarkList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getFollowedCityList",
     *     tags={"User"},
     *     description="获取用户关注城市的列表",
     *     operationId="getFollowedCityList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="limit",
     *         in="query",
     *         description="分页大小",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getFollowedCityList()
    {
        $loginSession = $this->loginSession;
        $limit = $this->limit;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getFollowedCityList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/info",
     *     tags={"User"},
     *     description="通过loginSession获取用户信息",
     *     operationId="getUserInfo",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取用户信息",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUserInfo()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUserInfo($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        $user = $response->data;
        return $this->response($response->code, $response->message, $user[0]);
    }

    /**
     * @SWG\Get(
     *     path="/user/getYiiccaMenu",
     *     tags={"User"},
     *     description="获取一间咖啡馆用户菜单",
     *     operationId="getYiiccaMenu",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取合作者信息",
     *         required=false,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getYiiccaMenu()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getYiiccaMenu($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Post(
     *     path="/user/setMenu",
     *     tags={"User"},
     *     description="获取用户菜单",
     *     operationId="setUserMenu",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取合作者信息",
     *         required=false,
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="menu_id_str",
     *         in="query",
     *         description="菜单ID字符串",
     *         required=false,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function setUserMenu()
    {
        $loginSession = $this->loginSession;
        $menu_id_str = $this->menu_id_str;
        $data = [
            'loginSession' => $loginSession,
            'menu_id_str' => $menu_id_str
        ];
        $response = UserLogic::setUserMenu($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Post(
     *     path="/user/getCashCoupon",
     *     tags={"User"},
     *     description="用户获取代金券",
     *     operationId="getCashCoupon",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="cash_coupon_id",
     *         in="query",
     *         description="代金券ID",
     *         required=true,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getCashCoupon()
    {
        $loginSession =  $this->loginSession;
        $cash_coupon_id = $this->cash_coupon_id;
        $data = [
            'loginSession' => $loginSession,
            'cash_coupon_id' => $cash_coupon_id
        ];
        $response = UserLogic::getCashCoupon($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getCashCouponList",
     *     tags={"User"},
     *     description="获取用户的代金券列表",
     *     operationId="getUserCashCouponList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUserCashCouponList()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUserCashCouponList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getPartyList",
     *     tags={"User"},
     *     description="获取用户参加的活动列表",
     *     operationId="getUserPartyList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUserPartyList()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUserPartyList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getFollowedCafeList",
     *     tags={"User"},
     *     description="获取用户关注的咖啡馆",
     *     operationId="getFollowedCafeList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getFollowedCafeList()
    {
        $loginSession = $this->loginSession;
        $limit = $this->limit;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getFollowedCafeList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getSharedCafeList",
     *     tags={"User"},
     *     description="获取用户分享的咖啡馆列表",
     *     operationId="getSharedCafeList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取合作者信息",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getSharedCafeList()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getSharedCafeList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Post(
     *     path="/user/checkLogin",
     *     tags={"User"},
     *     description="验证登录",
     *     operationId="checkLogin",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取合作者信息",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function checkLogin()
    {
        $loginSession = $this->loginSession;
        if (!Redis::get($loginSession)){
            // 用户没有登录
            return self::response(0, 0);
        }
        return self::response(0, 1);
    }


    /**
     * @SWG\Post(
     *     path="/user/setInit",
     *     tags={"User"},
     *     description="用户初始化",
     *     operationId="setUserInit",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥，并且通过loginSession获取合作者信息",
     *         required=false,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function setUserInit()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::setUserInit($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Post(
     *     path="/user/praiseDynamic",
     *     tags={"User"},
     *     description="用户点赞动态操作",
     *     operationId="praiseDynamic",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="dynamic_id",
     *         in="query",
     *         description="动态ID",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function praiseDynamic()
    {
        $loginSession = $this->loginSession;
        $dynamic_id = $this->dynamic_id;
        $data = [
            'loginSession' => $loginSession,
            'dynamic_id' => $dynamic_id
        ];
        $response = UserLogic::praiseDynamic($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getPraiseDynamicList",
     *     tags={"User"},
     *     description="获取用户点赞动态列表",
     *     operationId="getPraiseDynamicList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="limit",
     *         in="query",
     *         description="分页大小",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getPraiseDynamicList()
    {
        $limit = $this->limit;
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getPraiseDynamicList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getDynamicCommentList",
     *     tags={"User"},
     *     description="获取用户评论列表",
     *     operationId="getDynamicCommentList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="limit",
     *         in="query",
     *         description="分页大小",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getDynamicCommentList()
    {
        $limit = $this->limit;
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getDynamicCommentList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getPraiseList",
     *     tags={"User"},
     *     description="获取别人给的赞列表",
     *     operationId="getPraiseList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="limit",
     *         in="query",
     *         description="分页大小",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getPraiseList()
    {
        $limit = $this->limit;
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getPraiseList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getCommentList",
     *     tags={"User"},
     *     description="获取别人对我动态的评论",
     *     operationId="getCommentList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Parameter(
     *         name="limit",
     *         in="query",
     *         description="分页大小",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getCommentList()
    {
        $limit = $this->limit;
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession,
            'limit' => $limit
        ];
        $response = UserLogic::getCommentList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getUnreadPraiseCount",
     *     tags={"User"},
     *     description="获取未读的别人给的赞的数量",
     *     operationId="getUnreadPraiseCount",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUnreadPraiseCount()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUnreadPraiseCount($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getUnreadCommentCount",
     *     tags={"User"},
     *     description="获取未读的别人评论的数量",
     *     operationId="getUnreadCommentCount",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUnreadCommentCount()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUnreadCommentCount($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/getUnreadSystemNotifyCount",
     *     tags={"User"},
     *     description="获取未读的通知数量",
     *     operationId="getUnreadSystemNotifyCount",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUnreadSystemNotifyCount()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUnreadSystemNotifyCount($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * @SWG\Get(
     *     path="/user/detail",
     *     tags={"User"},
     *     description="获取用户详情",
     *     operationId="getUserDetail",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="loginSession",
     *         in="query",
     *         description="验证秘钥",
     *         required=true,
     *         type="string",
     *         @SWG\Items(type="string"),
     *         collectionFormat="csv"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getUserDetail()
    {
        $loginSession = $this->loginSession;
        $data = [
            'loginSession' => $loginSession
        ];
        $response = UserLogic::getUserDetail($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }
}